<?php

namespace app\admin\controller;

class Software_upgrade_log
{
    /**
     * @actionName  升级日志
     * @show 1
     * 展示设置
     */
    public function index()
    {
        $paramsObj = paramsObj();
        $paramsObj->params = array(
            "format" => 1,
        );
        $response = app("C_Admin_software_upgrade_log")->listData($paramsObj);
        $listData = array();
        if ($response["success"]) {
            $listData = $response["data"];
        }
        $data = array();
        $data["listData"] = $listData;
        $data["request"] = request()->param();
        return view("admin/software_upgrade_log/index", $data);
    }

    /**
     * @actionName  添加
     * @show 2
     * 展示设置
     */
    public function create()
    {
        $data = array();
        $data["request"] = request()->param();
        return view("admin/software_upgrade_log/create", $data);
    }

    /**
     * @actionName  编辑
     * @show 2
     * 展示设置
     */
    public function edit()
    {
        $response = app("C_Admin_software_upgrade_log")->info();
        $rowData = array();
        if ($response["success"]) {
            $rowData = $response["data"];
        }
        if ($rowData) {
            $data = array();
            $data["rowData"] = $rowData;
            $data["request"] = request()->param();
            return view("admin/software_upgrade_log/edit", $data);
        } else {
            return view("admin/error/noData");
        }
    }

    /**
     * @actionName  详情
     * @show 2
     * 展示设置
     */
    public function info()
    {
        $response = app("C_Admin_software_upgrade_log")->info();
        $rowData = array();
        if ($response["success"]) {
            $rowData = $response["data"];
        }
        if ($rowData) {
            $data = array();
            $data["rowData"] = $rowData;
            $data["request"] = request()->param();
            return view("admin/software_upgrade_log/info", $data);
        } else {
            return view("admin/error/noData");
        }
    }

    /**
     * @actionName  创建资源
     * @show 2
     * 展示设置
     */
    public function store()
    {
        $result = app("C_Admin_software_upgrade_log")->store();
        return jsonResponse($result);
    }

    /**
     * @actionName  更新资源
     * @show 2
     * 展示设置
     */
    public function update()
    {
        $result = app("C_Admin_software_upgrade_log")->update();
        return jsonResponse($result);
    }

    /**
     * @actionName  删除
     * @show 2
     * 展示设置
     */
    public function delete()
    {
        $result = app("C_Admin_software_upgrade_log")->delete();
        return jsonResponse($result);
    }
}